package com.wsd.jing.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wsd.jing.validator.group.InsertGroup;
import com.wsd.jing.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * All rights Reserved, Designed By www.tom.com
 *
 * @author tom
 * @version 1.0.0
 * @projectName: jing
 * @packageName: com.wsd.jing.entity
 * @className: UserPost
 * @description: 用户职位关联
 * @createDate 2022-11-14 07:02
 * @copyright 2022-11-14 07:02 www.tom.com Inc. All rights reserved.
 */
@Getter
@Setter
@ToString
@TableName("j_user_post")
@ApiModel(value = "UserPost对象", description = "用户职位关联表")
public class UserPost implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "用户岗位ID不能为空", groups = UpdateGroup.class)
    @Null(message = "用户岗位ID为空", groups = InsertGroup.class)
    @ApiModelProperty("用户岗位ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @NotNull(message = "用户ID不能为空")
    @ApiModelProperty("用户ID")
    @TableField("user_id")
    private Integer userId;

    @NotNull(message = "岗位ID不能为空")
    @ApiModelProperty("岗位ID")
    @TableField("post_id")
    private Integer postId;


}
